package com.yan.domain;

public class Student {
    private String name;
    private int age;
    private int num;
    private String sex;

    public Student(String name, int age, int num, String sex) {
        this.name = name;
        this.age = age;
        this.num = num;
        this.sex = sex;
    }

    public Student() {
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getNum() {
        return num;
    }

    public void setNum(int num) {
        this.num = num;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student student = (Student) o;

        if (num != student.num) return false;
        return name != null ? name.equals(student.name) : student.name == null;
    }

    @Override
    public int hashCode() {
        int result = name != null ? name.hashCode() : 0;
        result = 31 * result + num;
        return result;
    }

    @Override
    public String toString() {
        return "Test3{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", num=" + num +
                ", sex='" + sex + '\'' +
                '}';
    }

    public void student(){
        System.out.println("学习");
    }
    public void sleep(){
        System.out.println("睡觉");
    }

    public void eat(){
        System.out.println("吃饭");
    }

}
